//
//  LocationTableViewCell.m
//  EasyBuy
//
//  Created by apple on 12-10-20.
//  Copyright (c) 2012年 shen donghao. All rights reserved.
//

#import "LocationTableViewCell.h"

@implementation LocationTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        
        Price = [[UILabel alloc] initWithFrame:CGRectMake(10, 5, 70, 30)];
        Price.textColor = [UIColor redColor];
        Price.font = [UIFont systemFontOfSize:15];
        Price.backgroundColor = [UIColor clearColor];
        [self addSubview:Price];
        
        formerlyPrice = [[UILabel alloc] initWithFrame:CGRectMake(12, 30, 100, 30)];
        formerlyPrice.textColor = [UIColor grayColor];
        formerlyPrice.font = [UIFont systemFontOfSize:13];
        formerlyPrice.backgroundColor = [UIColor clearColor];
        [self addSubview:formerlyPrice];
        
        title = [[UILabel alloc] initWithFrame:CGRectMake(90, 5, 200, 30)];
        title.font = [UIFont systemFontOfSize:16];
        title.backgroundColor = [UIColor clearColor];
        [self addSubview:title];
        
        time = [[UILabel alloc] initWithFrame:CGRectMake(90, 32, 50, 30)];
        time.textColor = [UIColor grayColor];
        time.font = [UIFont systemFontOfSize:13];
        time.backgroundColor = [UIColor clearColor];
        [self addSubview:time];
        
        distance = [[UILabel alloc] initWithFrame:CGRectMake(230, 32, 50, 30)];
        distance.textColor = [UIColor grayColor];
        distance.backgroundColor = [UIColor clearColor];
        distance.font = [UIFont systemFontOfSize:13];
        [self addSubview:distance];
    }
    return self;
}

- (void)setCellInfoData:(GoogleMapInfoData *)googleMapInfoData{
    priceStr = 200;
    formerlyPriceStr = 229;
    titleStr = @"TP link TL-R478+ 路由器";
    timeStr = @"10天前";
    distanceStr = @"385米";
    
    [self setCEllInfoDataShow];
}

- (void)setCEllInfoDataShow{
    Price.text = [NSString stringWithFormat:@"￥%d.00",priceStr];
    formerlyPrice.text = [NSString stringWithFormat:@"￥%d.00",formerlyPriceStr];
    title.text = titleStr;
    time.text = timeStr;
    distance.text = distanceStr;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setCellInfoDataWithData:(NSString *)string{
    
        title.text = string;
    
    
}

@end
